<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <base href="/">
    <link rel="stylesheet" href="../static/layui/css/layui.css">
    <script src="../static/js/jquery-3.2.1.min.js"></script>
    <script src="../static/layui/layui.js"></script>
    <script>
        $(function () {
            // 填充管理员信息
            $.get({
                url: 'admin/info/get',
                success: function (result) {
                    if (result && result.success) {
                        var data = result.data.data;
                        $("#username").text(data.username);
                    } else {
                        layer.msg(result.message);
                    }
                }
            });
        });

        // 退出
        function logout() {
            $.get({
                url: "admin/logout",
                success: function (result) {
                    window.location.href = 'static/login.html';
                }
            })
        }

        // 个人信息
        function showInfo() {
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                area: ['420px', '300px'], //宽高
                content: '../static/userInfo.html'
            })
        }

        // 修改密码
        function updatePassword() {
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                area: ['420px', '300px'], //宽高
                content: '../static/updatePassword.html'
            })
        }
    </script>
    <style>
        dl {
            z-index: 999;
        }
    </style>
</head>
<body>
<div align="right">
    <ul class="layui-nav">
        <li class="layui-nav-item">
            <a href="javascript:void(0)">您好，<span id="username">管理员</span></a>
            <dl class="layui-nav-child">
                <dd><a href="javascript:showInfo();">个人信息</a></dd>
                <dd><a href="javascript:updatePassword();">修改密码</a></dd>
                <dd><a href="javascript:logout();">退出</a></dd>
            </dl>
        </li>
    </ul>
</div>
</body>
</html>